<%@ page language="java" contentType="text/html; charset=UTF-8"   pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ include file="international.jsp" %> 
<jsp:useBean id="trackerService" class="com.brother.service.TrackerService"></jsp:useBean>
<jsp:useBean id="carmodelService" class="com.brother.service.CarModelService"></jsp:useBean>
<jsp:useBean id="userService" class="com.brother.service.UserService"></jsp:useBean>
<%
com.brother.model.Customer user = (com.brother.model.Customer)session.getAttribute(com.brother.Constants.LOGIN_SESSTION_NAME);

String isInPopupWindow = request.getParameter("isInPopupWindow");
session.setAttribute("isInPopupWindow", isInPopupWindow);

if(user == null)
	return;
String trackerId = request.getParameter("trackerid") == null ?"":request.getParameter("trackerid").trim();

com.brother.model.Tracker	tracker = trackerService.getTrackerByFieldName("trackerid",trackerId);
		com.brother.model.Customer	trackerUser = userService.GetUserByUserId(tracker.getUserid());
	
%>


<table align="left"  border="1" class="tableBorder1" cellpadding="5" width="100%">

  <tr valign="top">
    <th width="180" align="right" valign="top"><fmt:message key="tracker.name"/></th>
    <td  align="left"><%=tracker==null?"":tracker.getTrackerName()%></td>
  </tr>
  <tr valign="top">
    <th align="right" valign="top"><fmt:message key="tracker.model"/></th>
    <td  align="left">
    <img src="" id="modelImage" alt=""/>
    <script type="text/javascript">
    document.getElementById('modelImage').src = getOnlineIcon({model:'<%=tracker!=null?(tracker.getModelName() != null ?  tracker.getModelName() : ""):""%>'});
    </script>
  
    </td>
  </tr>
  <tr>

	<th align="right"><fmt:message key="tracker.protocol"/>:</th>
					<td align="left"><%if((tracker!=null?(tracker.getCarmodelId() == null || tracker.getCarmodelId().equals(com.brother.model.Tracker.PROTOCOL_EV02)):true)){%><fmt:message key="tracker.protocol.default"/><%}%>
					<%if((tracker!=null?(tracker.getCarmodelId().equals(com.brother.model.Tracker.PROTOCOL_TL201)):false)){%><fmt:message key="tracker.protocol.TL201"/><%}%>
					<%if((tracker!=null?(tracker.getCarmodelId().equals(com.brother.model.Tracker.PROTOCOL_TL108)):false)){%><fmt:message key="tracker.protocol.TL108"/><%}%>
					<%if((tracker!=null?(tracker.getCarmodelId().equals(com.brother.model.Tracker.PROTOCOL_EV06)):false)){%>EV06<%}%>
					
	</tr>
  <tr>
    <th align="right"><fmt:message key="tracker.id"/></th>
    <td align="left"><%=tracker==null?"":tracker.getUserTrackerId()%></td>
  </tr>
    <tr>
    <th align="right"><fmt:message key="tracker.receive.mail"/></th>
    <td align="left"><%=tracker==null?"":(tracker.isMailEnabled()?"Yes":"No")%></td>
  </tr>
  <tr>
    <th align="right"><fmt:message key="tracker.driver.id"/>    </th>
    <td align="left"><%=tracker==null?"":tracker.getDriverID()%></td>
  </tr>
  <tr>
    <th align="right"><fmt:message key="tracker.driver.name"/>    </th>
    <td align="left"><%=tracker==null?"":tracker.getDriverName()%></td>
  </tr>
  <tr>
    <th align="right"><fmt:message key="tracker.driver.mobile"/>    </th>
    <td align="left"><%=tracker==null?"":tracker.getDriverMobile()%></td>
  </tr>
  <tr>
    <th align="right"><fmt:message key="tracker.remark"/></th>
    <td align="left"><%=tracker==null?"":(tracker.getRemark() == null ? "":tracker.getRemark())%></td>
  </tr>
  <tr>
    <td colspan="2" align="right" bgcolor="#FFFFFF"><span class="STYLE1"></span></td>
  </tr>
  <tr>
    <th colspan="2" align="right"><fmt:message key="user.info"/>    </th>
  </tr>
  <tr>
    <th align="right"><fmt:message key="user.id"/>    </th>
    <td align="left"><%=trackerUser.getName()%></td>
  </tr>

  <tr>
    <th align="right"><fmt:message key="user.username"/>    </th>
    <td align="left"><%=trackerUser.getRealName()%></td>
  </tr>
  <tr>
    <th align="right"><fmt:message key="user.gender"/></th>
    <td align="left"><%=trackerUser.getGender()%></td>
  </tr>
  <tr>
    <th align="right"><fmt:message key="user.company.name"/>    </th>
    <td align="left"><%=tracker==null?"":trackerUser.getCompanyName()%></td>
  </tr>
  <tr>
    <th align="right"><fmt:message key="user.email"/></th>
    <td align="left"><%=tracker==null?"":trackerUser.getEmail()%></td>
  </tr>
  <tr>
    <th align="right"><fmt:message key="user.address"/></th>
    <td align="left"><%=tracker==null?"":trackerUser.getAddress()%></td>
  </tr>
  <tr>
    <th align="right"><fmt:message key="user.country"/></th>
    <td align="left"><%=tracker==null?"":trackerUser.getCountry()%></td>
  </tr>
  <tr>
    <th align="right"><fmt:message key="user.mobile"/></th>
    <td align="left"><%=tracker==null?"":trackerUser.getMobile()%></td>
  </tr>
  <tr>
    <th align="right"><fmt:message key="user.fax"/></th>
    <td align="left"><%=tracker==null?"":trackerUser.getFax()%></td>
  </tr>
  <tr>
    <th align="right"><fmt:message key="user.phone.number"/>    </th>
    <td align="left"><%=tracker==null?"":trackerUser.getPhoneNumber()%></td>
  </tr>
  <tr>
    <th align="right"><fmt:message key="user.description"/></th>
    <td align="left"><%=tracker==null?"":trackerUser.getDescription()%></td>
  </tr>
</table>

<%
com.brother.database.DataBase.closeThreadConnection();
%>